package org.dromara.pdf.fop.support.font;


import org.apache.fop.fonts.FontInfo;

/**
 * 字体信息助手
 *
 * @author xsx
 * @date 2025/1/23
 * @since 1.8
 * <p>
 * Copyright (c) 2020 xsx All Rights Reserved.
 * x-easypdf-fop is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 * http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 * </p>
 */
public class FontInfoHelper {

    /**
     * 字体信息
     */
    private static final ThreadLocal<FontInfo> INFO = new ThreadLocal<>();

    /**
     * 初始化
     *
     * @param fontInfo 字体信息
     */
    public static void init(FontInfo fontInfo) {
        INFO.set(fontInfo);
    }

    /**
     * 获取
     *
     * @return 返回字体信息
     */
    public static FontInfo get() {
        return INFO.get();
    }

    /**
     * 移除
     */
    public static void remove() {
        INFO.remove();
    }
}
